﻿// See https://aka.ms/new-console-template for more information
Console.Write("Input your number A: ");
var stringA = Console.ReadLine();
int numberA;
while (!int.TryParse(stringA, out numberA))
{
    Console.Write("Please enter a number: ");
    stringA = Console.ReadLine();
}
Console.Write("Input your number B: ");
var stringB = Console.ReadLine();

int numberB;
while (!int.TryParse(stringB, out numberB))
{
    Console.Write("Please enter a number: ");
    stringB = Console.ReadLine();
}
Console.Write("Please enter a operator(+ - / *): ");
var calcOperator = Console.ReadLine();
var result = calcOperator switch
{
    "+" => numberA + numberB,
    "-" => numberA - numberB,
    "*" => numberA * numberB,
    "/" => numberA / numberB,
    _ => throw new Exception("Un supported operator")
};
Console.WriteLine($"The result of calculating is: {result}");